// types/auth.ts
export interface User {
  id: number
  username: string
  email: string
  full_name: string
  phone?: string
  institution?: string
  institution_name?: string
  laboratory?: string
  laboratory_name?: string
  user_type: 'member' | 'laboratory'
  date_joined: string
  last_login?: string
}

export interface Institution {
  code: string
  name: string
}

export interface Laboratory {
  code: string
  name: string
  institution: string
  institution_name: string
}

export interface LoginRequest {
  email: string
  password: string
  institution?: string
  laboratory?: string
  user_type: 'member' | 'laboratory' // 改为必需字段
}



export interface AuthResponse {
  message: string
  user: User
  tokens: {
    access: string
    refresh: string
  }
}

// 用户类型检查响应
export interface UserTypeCheckResponse {
  exists: boolean
  user_type?: 'laboratory' | 'member'
  full_name?: string
  institution_name?: string
  laboratory_name?: string
}